import { Directive, Input, ViewContainerRef, TemplateRef } from '@angular/core';

@Directive({
  selector: '[mySelectDirective]'
})
export class MySelectDirectiveDirective {
  @Input()
  set mySelectDirective(item: any) {
    for (const key in item) {
      if (key) {
        this.vcr.createEmbeddedView(this.tpl, {
            $implicit: {
              key,
              value: item[key]
            }
        });
      }
    }
  }
  constructor(private vcr: ViewContainerRef, private tpl: TemplateRef<any>) { }
}
